#!/usr/bin/python3

from threading import Thread
import time

count = 0

def timer(name, n):
    global count
    while True and count < 10:
        print("{} : {} ".format(name, time.strftime('%Y-%m-%d %X',time.localtime())))
        time.sleep(n)
        count += 1

if __name__ == "__main__":
    t1 = Thread(target=timer, args=('Thread1', 1))
    t2 = Thread(target=timer, args=('Thread2', 2))
    
    t1.start()
    t2.start()

    t1.join()
    t2.join()
